<template>
  <div>
    <ul><li v-for="(obj,index) in arr " :key="index">{{obj}}<button @click="sc(index)">删除</button></li>
    </ul>
    <button @click="btn">生成</button>
  </div>

</template>

<script>
export default {
data () {
  return {
    arr:[1,5,3,9]
  }
},
methods:{
btn(){
  this.arr.push(Math.floor(Math.random() *100))
},
sc(index){
  this.arr.splice(index,1)
}
}
}
</script>

<style>

</style>